#ifndef SERVER_H
#define SERVER_H

#include <string>
#include <arpa/inet.h>

class Server {
public:
    Server(int server_id);
    ~Server();
    void send(int to_id, std::string message);
    std::string read();
    // void run();

private:
    int id;
    int sock;
    struct sockaddr_in addr;

    // 默认地址表
    static const std::string DEFAULT_ADDR[3];

    // 提取地址中的port
    int extractPort(const std::string &address);
};


#endif